<?php

    include_once("config.php");

    ob_start();
    include_once(INCLUDE_DIR. "/Product.php");
    ob_clean();

    $order = !empty($_REQUEST["order"]) ? $_REQUEST["order"] : "add_time desc";
    $no = !empty($_REQUEST["no"]) ? $_REQUEST["no"] : 0;

    $myMySQL = new MySQL();
    $myMySQL->connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
   
    $myProduct = new Product($myMySQL);

    if( empty($no) )
    {
        Output::error('案例编号不能为空', '10001');
    }

    $row = $myProduct->getRow("*", "no = $no AND is_online = 'Y'");
   
    if( empty($row) )
    {
        Output::error('案例不存在或已下线', '10001');
    }

    $dataArray = $myProduct->getDataClean($row);

    Output::succ('', $dataArray);

?>